<?php
    require "sql.php";
    $filename = $_GET['filename'];
    $username = $_COOKIE['username'];
    $str1="select * from file where author = '".$username."' and file_name = '".$filename."'";
    $result = $conn->query($str1);
    if ($result->num_rows > 0) {
        while($row = $result->fetch_assoc()) {
            $content=$row['content'];
            $isPublic=$row['isPublic'];
        }
    } else {
        echo "<script>
                        alert('抱歉！您没有权限编辑此文件！');
                       window.location.href='./'; 
            </script>";

    }
    $conn->close();
